package JavaDesign.report_finish;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zouran
 * createDate：2023/12/23  0:24
 */
public class DataView {
    List<User> userList = new ArrayList<>();

    public DataView() {
        userList.add(new Student("Ethan", "普通班", "高一1班"));
        userList.add(new Student("Tom", "重点班", "高一2班"));
        userList.add(new Student("Peter", "重点班", "高一3班"));
        userList.add(new Teacher("张三", "普通班", "高一1班"));
        userList.add(new Teacher("李四", "重点班", "高一2班"));
        userList.add(new Teacher("王五", "重点班", "高一3班"));
    }

    public void show(Visitor visitor) {
        for (User user : userList) {
            user.accept(visitor);
        }
    }
}
